/**
 * @file app entry
 * @author renjian
 * @date 2017/3/22
 */
import Vue from 'vue';
import App from '../App.vue';
import CoUI from 'coui';
import VueRouter from 'vue-router';
import index from './index.vue';

document.addEventListener('DOMContentLoaded', function() {
  if (window.FastClick) window.FastClick.attach(document.body);
}, false);

Vue.use(CoUI);
Vue.use(VueRouter);

var routes = [
  {
    path: '/',
    name: 'index',
    component: index
  },
  // 错误路径重定向到首页
  {
    path: '*',
    redirect: '/'
  }
];

const router = new VueRouter({
  base: __dirname,
  routes
});

new Vue({ // eslint-disable-line
  el: '#app',
  render: h => h(App),
  router
});
